package com.ganbo.demo.caffeine.controller;


import com.ganbo.demo.caffeine.pojo.User;
import com.ganbo.demo.caffeine.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("/init")
    public String init() {
        userService.init();
        return "success";
    }

    @GetMapping("/get")
    public User get(Integer id) {
        return userService.get(id);
    }


}

